package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.Reservation;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.Map;

@Mapper
public interface ReservationMapper {
    Page<Reservation> selectByPage(Integer status);

    Integer getCancelledReservationCount(Long user,LocalDateTime startTime,LocalDateTime endTime);



    void addReservation(Reservation reservation);

    void cancelReservation(Long id);

    @MapKey("time")
    Map<String, Object> getReservationCountByTime(LocalDateTime startTime, LocalDateTime endTime);


    Integer getReservationCount(LocalDateTime time);

    String getReservationStatus(Long id);

    void cancelReservationAuto(LocalDateTime time);

    Integer getReservationCountByMobile(String mobile,LocalDateTime getTime);
}
